using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO;

namespace FodeeAdmin.SystemSettings
{
    public partial class SystemSettingsForm : BaseSystemSettingsForm
    {
        public SystemSettingsForm()
        {
            InitializeComponent();
        }

        private void SystemSettingsForm_Load(object sender, EventArgs e)
        {
            //this.skinEngine1.SkinFile = Application.StartupPath + @"\Skins\EmeraldColor1.ssk";
            comboBox1.SelectedValue = "EmeraldColor1.ssk";

            string path = Application.StartupPath + @"\Skins";
            if (!Directory.Exists(path))
            {
                return;
            }

            List<ListItem> li = new List<ListItem>();

            DirectoryInfo mydir = new DirectoryInfo(path);
            foreach (FileInfo file in mydir.GetFiles())
            {
                li.Add(new ListItem(file.Name, file.Name));
            }

            this.comboBox1.DataSource = li;
            this.comboBox1.DisplayMember = "Text";
            this.comboBox1.ValueMember = "Value";
        }


        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            //this.skinEngine1.SkinFile = Application.StartupPath + @"\Skins\" + this.comboBox1.SelectedValue.ToString();
        }

        public partial class ListItem
        {
            private string _text;
            public string Text
            {
                get
                {
                    return _text;
                }
                set
                {
                    _text = value;
                }
            }

            private string _value;
            public string Value
            {
                get
                {
                    return _value;
                }
                set
                {
                    _value = value;
                }
            }

            public ListItem(string text, string value)
            {
                this.Text = text;
                this.Value = value;
            }
        }
    }
}